/**
 * @file UserKvSave.h
 * @brief 
 * @author xuesong (wenshaoliu@foxmail.com)
 * @version 1.0
 * @date 2023-07-13
 * 
 * @copyright Copyright (c) 2023  by xuesong
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2023-07-13     <td>1.0     <td>xuesong   <td>内容
 * </table>
 */
#ifndef __USER_KV_SAVE_H__
#define __USER_KV_SAVE_H__


#include "bcomdef.h"
#include "user_prcess.h"
#ifdef __cplusplus
extern "C"
{
#endif
//===================================================
// <o> FLASH_CONTOR_TYPE
// <0=> Use easyflash
// <1=> Use flash data base
#ifndef   FLASH_CONTOR_TYPE
#define   USE_EASYFLASH         0
#define   USE_FLASHDB           1
#define   FLASH_CONTOR_TYPE     USE_EASYFLASH     
#endif
//===================================================
#if(FLASH_CONTOR_TYPE ==  USE_EASYFLASH)
#include "easyflash.h"
#include <ef_cfg.h>
#include <ef_def.h>
#elif(FLASH_CONTOR_TYPE ==  USE_FLASHDB)
#include "flashdb.h"
#endif
//===================================================
#define MEM_DATA_KEY            "KM_MD_"
#define UTC_TIME_KEY 			"KM_UTC"
//===================================================
void UserFlashSaveInit(void);
size_t user_get_env_blob(const char *key, void *value_buf, size_t buf_len);
size_t user_set_env_blob(const char *key, void *value_buf, size_t buf_len);
void UserHalRtcInit(void);
//===================================================
#ifdef __cplusplus
}
#endif

#endif


